package com.xu.service;

import com.xu.mapper.UserMapper;
import com.xu.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    //service调mapper层
    @Autowired
    private UserMapper userMapper;

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    public User queryUserById(int uid) {
        return userMapper.queryUserById(uid);
    }

    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    public int delUser(int userid)
    {
        return userMapper.delUser(userid);
    }

    public int updUser(User user)
    {
        return userMapper.updUser(user);
    }

    public List<User> getAllUser() {
        return userMapper.getAllUser();
    }
}
